package com.baiqian.doupo.block;

import com.baiqian.doupo.fluids.FluidsRegistry;
import com.baiqian.doupo.tileentity.ZhuJiLingYeTileEntity;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockReader;

import javax.annotation.Nullable;

public class ZhuJiLingYe  extends FlowingFluidBlock {
    public ZhuJiLingYe() {
        super(FluidsRegistry.zhu_ji_ling_ye_fluid, Block.Properties.create(Material.WATER).doesNotBlockMovement().hardnessAndResistance(100.0F).noDrops());
    }

    @Override//这组函数让你的方块可以绑定一个方块实体，hasTileEntity返回值设置为true，说明我们这个方块拥有一个方块实体
    public boolean hasTileEntity(BlockState state) {
        return true;
    }

    @Nullable
    @Override//这个函数决定了我们方块的方块实体具体是哪一个，在我们的例子里是ObsidianCounterTileEntity
    public TileEntity createTileEntity(BlockState state, IBlockReader world) {
        return new ZhuJiLingYeTileEntity();
    }
}
